package cn.huixh.blindbox.controller;

import cn.huixh.blindbox.annotation.TokenVerify;
import cn.huixh.blindbox.common.Common;
import cn.huixh.blindbox.utils.ToolsUtil;
import io.github.yedaxia.apidocs.Ignore;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author huixh
 * @version 1.0
 * @date 2022/5/11 11:35
 */
@Slf4j
@Ignore
@Controller
@RequestMapping("/demo")
public class DemoController {

    @Resource
    private ToolsUtil toolsUtil;

    @TokenVerify
    @GetMapping(value = "/url")
    @ResponseBody
    public String getUrl(@RequestHeader(Common.TOKEN_KEY) String token) {
        System.out.println(token);
        return toolsUtil.getFullUrl();
    }

}
